package com.grt.condify.dto;

import com.grt.condify.annotation.GroupBy;
import com.grt.condify.annotation.OrderType;
import com.grt.condify.annotation.SearchType;
import com.grt.condify.common.constant.CommonConstants;
import com.grt.condify.common.constant.OrderTypeValue;
import com.grt.condify.common.constant.SearchTypeValue;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
public class PersonListDTO extends BaseDTO {


    @ApiModelProperty(value = "年龄")
    @SearchType(searchField = "age", type = SearchTypeValue.EQ)
    private Integer age;

    @ApiModelProperty(value = "姓名")
    @SearchType(searchField = "name",type = SearchTypeValue.LIKE)
    private String name;

    @ApiModelProperty(value = "检索值：支持多字检索")
    @SearchType(searchFields = {"name","nick_name"},sfType = CommonConstants.SPECIAL_SEARCH_FILED_TYPE,type = SearchTypeValue.LIKE)
    private String searchValue;

//    @ApiModelProperty(value = "排序字段")
//    @OrderType(type = OrderTypeValue.DESC)
//    private String cr_time;

    @ApiModelProperty(value = "排序字段")
    @OrderType(orderFiled = "cr_time")
    private String orderBy = CommonConstants.ORDER_DESC;

    @GroupBy(groupByFields = {"age","nick_name"})
    private String groupBy;
}
